Subject: Of Mice & Skidmarks...
From: [email-masked]
To: [email-masked]
Date: Wed, 8 Sep 93 09:35:21 BST

For anyone who is interested, here's some code I knocked up to read a mouse
plugged into the second mouse port. Now I'm not saying this is at all how
it should be done in 'proper' AMOS programs, because it really needs to
check the mouse counters at LEAST 100 times a second to stay accurate, but
at least it shows how easy it is to do if someone cares to write a better
interrupt driven version (*hint*)

BTW - I'm loading in the bank off the original AMOS disk that contains the
      definition of the mouse pointer. AMOS Pro users can either try to
      locate the same thing on their Pro system disk or just use any other
      sprite bank they have lying around...

Load "amos:amos_system/mouse.abk" : Cls : Curs Off 

MX=X Hard(160) : MY=Y Hard(100)
DX=Peek($DFF00D) : DY=Peek($DFF00C)

Do 
      
   OLD_DX=DX : OLD_DY=DY
   DX=Peek($DFF00D) : DY=Peek($DFF00C)

   DIFF=DX-OLD_DX
   If DIFF<-127 Then DIFF=-255-DIFF
   If DIFF>127 Then DIFF=255-DIFF
   MX=MX+DIFF

   DIFF=DY-OLD_DY
   If DIFF<-127 Then DIFF=-255-DIFF
   If DIFF>127 Then DIFF=255-DIFF
   MY=MY+DIFF
      
   Print "Left  Button =";Fire(1)
   Print "Right Button =";-1-Btst(6,$DFF016)
   Home : Sprite 2,MX,MY,1 : Poke $DFF034,192

Loop 

The Poke to $DFF034 seems to be neccessary to keep the right mouse button
check going, I think it resets the paddle capacitor line that the button makes
use of. The left mouse button can be read using the normal joystick fire 
button function.

On the subject of Skidmarks, I wasn't suggesting you should desert Amos and
buy Blitz Basic instead ! Just that Amos could really use a similar sort of
game to show it off. To be honest, Skidmarks could probably be done just the
same in Amos anyway. It doesnt look like a vast amount of processing, just a
large lowres screen with a couple of bobs moving around on it. 

Martin.